<?php

namespace app\admin\controller;

use app\common\controller\LiteBase;
use app\common\util\Assert;
use think\Input;

class Test extends LiteBase
{
    public function index()
    {
        return $this->fetch();
    }

    public function save()
    {
        if (IS_POST) {
            try {
                $db = \app\common\model\Menu::instance();
                $postData = Input::post();
                Assert::notEmpty($postData, []);

                $saveData = [];

                $lastId = $db->add($saveData);
                if ($lastId) {
                    return $this->jsonSuccess('提交成功');
                }
            } catch (\Exception $ex) {

            }
        }
        return $this->jsonFail('系统忙');
    }

}